// Create a controller to use on a VisualForce page to list ideas 
    
public class IdeaListController {

    public final Idea[] ideas {get; private set;}

    public IdeaListController() {
        Integer i = 0;
        ideas = new Idea[1];
  
        for (Idea tmp : Database.query
('SELECT Id, Title FROM Idea WHERE Id != null AND parentIdeaId = null')) {
            i++;
            ideas.add(tmp);
        }
    }
}